package com.zlt.entity;


import com.alibaba.fastjson.annotation.JSONField;
import com.zlt.annotation.Column;
import com.zlt.annotation.Id;
import com.zlt.annotation.ManyToOne;

@com.zlt.annotation.Table(name = "table")
public class Table {

    @Id(name = "table_id")
    @JSONField
    private int tid;// 餐桌主键

    @ManyToOne(name = "table_tablename")
    @JSONField
    private com.zlt.entity.Table table;// 餐桌号

    @ManyToOne(name = "shop_id")
    @JSONField
    private User shop;// 商家id

    @ManyToOne(name = "user_id")
    @JSONField
    private User user;// 用户id

    @Column
    @JSONField
    private int state;// 餐桌状态,0空闲，1就餐中

    public Table() {
    }

    public Table(int tid, Table table, User shop, User user, int state) {
        this.tid = tid;
        this.table = table;
        this.shop = shop;
        this.user = user;
        this.state = state;
    }

    public int getTid() {
        return tid;
    }

    public void setTid(int tid) {
        this.tid = tid;
    }

    public Table getTable() {
        return table;
    }

    public void setTable(Table table) {
        this.table = table;
    }

    public User getShop() {
        return shop;
    }

    public void setShop(User shop) {
        this.shop = shop;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return "Table{" +
                "tid=" + tid +
                ", table=" + table +
                ", shop=" + shop +
                ", user=" + user +
                ", state=" + state +
                '}';
    }
}
